package com.chenzhou.product_sys;

import com.chenzhou.product_sys.common.Encrypt;
import com.chenzhou.product_sys.dao.impl.ProductDAOImpl;
import com.chenzhou.product_sys.entity.Product;

import java.util.List;

public class App {

    public static void main(String[] args) {
        //ProductDAOImpl dao = new ProductDAOImpl();
        //查询测试
        /*List<Product> list =  dao.queryAll();
        for (Product p:list) {
            System.out.println(p.getPname());
        }*/

        //添加测试
       /* Product p = new Product();
        p.setPname("苹果笔记本");
        p.setPprice(8000f);
        p.setPnum(10);
        String str = dao.add_product(p)>0?"成功":"失败";
        System.out.println(str);*/

        //删除测试
       /* String str1 = dao.delete_product(13)>0?"成功":"失败";
        System.out.println(str1);*/

        //修改测试
//        Product p1 = new Product();
//        p1.setPid(2);
//        p1.setPname("苹果笔记本");
//        p1.setPprice(8000f);
//        p1.setPnum(10);
//        String str2 = dao.modify_product(p1)>0?"成功":"失败";
//        System.out.println(str2);


        //加密密码
        String pwd="123";
        System.out.println(Encrypt.md5AndSha(pwd));
    }
}
